from openpyxl import load_workbook


class Excel_Data_Login:

    @staticmethod
    def read_login_success():
        wb = load_workbook(
            r"D:\PythonAutomatedTestingProject\WebAppInterfaceAutomationForAllCollectionFiles\ZhengzhouWebAutomationProject\WebAutomationEncapsulation\CaseFiles\login_demo.xlsx"
        )
        st = wb["登录成功"]
        data = [[st.cell(row=i, column=j).value for j in range(1, 4)] for i in range(2, st.max_row + 1)]
        return data


    @staticmethod
    def read_login_username_error():
        wb = load_workbook(
            r"D:\PythonAutomatedTestingProject\WebAppInterfaceAutomationForAllCollectionFiles\ZhengzhouWebAutomationProject\WebAutomationEncapsulation\CaseFiles\login_demo.xlsx"
        )
        st = wb["账号错误"]
        data = [[st.cell(row=i, column=j).value for j in range(1, 5)] for i in range(2, st.max_row + 1)]
        return data


    @staticmethod
    def read_login_password_error():
        wb = load_workbook(
            r"D:\PythonAutomatedTestingProject\WebAppInterfaceAutomationForAllCollectionFiles\ZhengzhouWebAutomationProject\WebAutomationEncapsulation\CaseFiles\login_demo.xlsx"
        )
        st = wb["密码错误"]
        data = [[st.cell(row=i, column=j).value for j in range(1, 7)] for i in range(2, st.max_row + 1)]
        return data
